package com.unicompayment.customkafka0_9;

import com.unicompayment.customkafka0_9.app.MyCustomerKafka;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class CustomKafka09Application implements CommandLineRunner {

    private final MyCustomerKafka myCustomerKafka;

    public CustomKafka09Application(MyCustomerKafka myCustomerKafka) {
        this.myCustomerKafka = myCustomerKafka;
    }

    public static void main(String[] args) {
        SpringApplication.run(CustomKafka09Application.class, args);
    }

    @Override
    public void run(String... args) {
        // 在应用启动时，执行逻辑
        try {
            myCustomerKafka.start();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {

        }
    }
}
